﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("---请依次输入姓名即可使用本产品---");
            Console.Write("请输入您的姓：");
            string s1 = Console.ReadLine();
            Console.Write("请输入您的名：");
            string s2 = Console.ReadLine();
            Compute compute = new Compute();
            Console.WriteLine("------------------------------------");
            Console.WriteLine(compute.Adds(s1, s2)+ "您好欢迎使用计算器1代");
            Console.WriteLine("------------------------------------");
            jxsy:
            Console.Write("请输入计算的第一个数：");
            double  num1 = double.Parse(Console.ReadLine());
            Console.Write("请输入计算的第二个数：");
            double num2 = double.Parse(Console.ReadLine());
            srcw:
            Console.Write("请输入需要进行运算的运算符号：");
            var s = Console.ReadLine();
            switch(s)
            {
                case "+":
                    Console.WriteLine($"{num1}+{num2}={ compute.Add(num1, num2)}");
                    break;
                case "-":
                    Console.WriteLine($"{num1}-{num2}={ compute.Minus(num1, num2)}" );
                    break;
                case "*":
                    Console.WriteLine($"{num1}*{num2}={ compute.Multiply(num1, num2)}");
                    break;
                case "/":
                    num2=compute.cs(num2);
                    Console.WriteLine($"{num1}/{num2}={compute.Divide(num1, num2)}");
                    break;
                case "%":
                    num2=compute.cs(num2);
                    Console.WriteLine($"{num1}%{num2}={compute.y(num1, num2)}");
                    break;
                default:
                    Console.WriteLine("输入的符号不正确请重新输入:");
                    goto srcw;

            }
            Console.WriteLine("输入y继续使用计算器：");
            var a = Console.ReadLine();
            if (a == "y" || a=="Y")
            {
                goto jxsy;
            }
            else
            {
                Console.WriteLine("感谢使用！");
            }
            

            


        }
    }
}
